package com.zqxq.file.service.impl;

import com.zqxq.file.config.YmlConfigFile;
import com.zqxq.file.service.IUploadFileService;
import com.zqxq.file.utils.UploadUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 说    明：  私有文件配置
 * 创 建 人：	一刀·胡
 * 创建时间：	2018/3/21 11:32
 * 修 改 人：
 * 修改日期：
 **/
@Slf4j
@Service("uploadFileServiceImplPrivate")
public class UploadFileServiceImplPrivate extends UploadForAttachment implements IUploadFileService {

    @Autowired
    private YmlConfigFile ymlConfig;

    @Override
    public String getS3Http() {
        return ymlConfig.getPrivate_http();
    }

    @Override
    public String getS3WriteAccessKey() {
        return ymlConfig.getWrite_access_key();
    }

    @Override
    public String getS3BucketName() {
        return ymlConfig.getPrivate_bucket_name();
    }

    @Override
    public String getS3WriteSceretKey() {
        return ymlConfig.getWrite_sceret_key();
    }

    /**
     * 后缀
     * @param object
     * @param fileSuff
     * @return
     */
    @Override
    public String getKey(Object object,String fileSuff) {

        return UploadUtil.getKey(object,fileSuff);
    }
}
